import { useState } from "react"
import Child from "./Child"
import { useEffect } from "react"

function TestView() {
  const [info, setInfo] = useState({})

  const getData = () => {
    setInfo({
      a: 1,
      b: 2
    })
  }

  const handleGet = () => {
    setInfo({
      a: 5,
      b: 7
    })
  }

  useEffect(() => {
    getData()
  }, [])

  return (
    <div>
      <Child info={info} />
      <button onClick={handleGet}>更新</button>
    </div>
  )
}

export default TestView

